return "CONSTRAIN TO LINE" & RETURN & RETURN & "[Advanced]" & RETURN & RETURN & "Creates a slider constrained to a straight line." & RETURN & RETURN & "Place the sprite at a position indicating the lowest value of the slider (typically the leftmost position) and use the behavior parameters to determine the direction the slider may be dragged." & RETURN & RETURN & "There are two methods to determine the direction of the slider:" & RETURN & RETURN & "The simplest is to select a direction (such as 'right') and a distance (in pixels) the slider can move. " & "Presets are available for each 45 degree angle." & RETURN & RETURN & "The other method is to choose 'point' and a coordinate for the sprite to move toward, allowing movements on other angles. " & "The initial position for the sprite to appear along the path is set by a number from 0 to 1 (default is 0.5, halfway between the maximum and minimum positions on the path)." & RETURN & RETURN & "The behavior broadcasts its current setting (always a number between 0 and 1) if the broadcast flag is set to anything but 0. " & "To intercept the broadcast, place an mConstrainedValue handler in a behavior on the target sprite." & RETURN & RETURN & "Example:" & RETURN & " on mConstrainedValue(me, vSlider, vValue)" & RETURN & RETURN & "vSlider is the sprite number of the slider sending the message (enabling tests if there is more than one slider operating); vValue is the slider's current position." & RETURN & RETURN & "Use the mSetConstrainPos method to set the position of the slider from another handler. " & "For example," & RETURN & RETURN & " sendSprite(sliderSpriteNum, #mSetConstrainPos, 0.66, FALSE)" & RETURN & RETURN & "would set the slider to a position two-thirds of the way between minimum and maximum positions without sending a new message to the broadcast sprite." & RETURN & RETURN & "The mIncrementConstrainPos handler can move the slider a set distance. " & "For example," & RETURN & RETURN & " sendSprite(sliderSprite, #mIncrementConstrainPos, 0.05)" & RETURN & RETURN & "would move the sprite 1/20th of the distance from the minimum position to the maximum position. " & "Negative values move toward the minimum position." & RETURN & RETURN & "PERMITTED MEMBER TYPES:" & RETURN & "bitmap, Flash, QuickTime" & RETURN & RETURN & "PARAMETERS:" & RETURN & "* Position slider first appears on path" & RETURN & "* Direction sprite will slide" & RETURN & "* Distance sprite moves (used for relative direction)" & RETURN & "* Vertical point coordinate (used for specific point)" & RETURN & "* Horizontal point coordinate (used for specific point)" & RETURN & "* Broadcast flag for slider position"
end
on getBehaviorTooltip me
return "[ADVANCED]" & RETURN & RETURN & "Makes a sprite draggable along a straight line." & RETURN & RETURN & "Place a sprite at one end of the line it should be dragged along, set parameters to determine the other end of the line, and where the draggable sprite should first appear. " & "The behavior can report its position along the line as a message to another sprite."
end
on beginSprite me
mInitialize(me)
end
on prepareFrame me
mUpdate(me)
end
on mouseDown me
pActive = 1
if sprite(pBroadcast).member.type = #quickTimeMedia then
setaProp(vPDList, #pDirection, [#comment: "Constraint direction (relative to current position)", #format: #string, #default: "Right", #range: mDirList()])